
import { getRedirectPath } from '../component/common/utils'
const REGISTER_SUCCESS = 'REGISTER_SUCCESS'
const LOGIN_SUCESS = 'LOGIN_SUCESS'
const ERROR_MSG = 'ERROR_MSG'
const LOAD_DATA = 'LOAD_DATA'
const initState = {
    redirectTo: '',
    isAuth: false,
    msg: '',
    user: '',
    type: '',
    test:''
}
// reducer
export function TestRedux(state = initState, action) {
    switch (action.type) {
        case ERROR_MSG:
            return { ...state, isAuth: false, msg: action.msg }
        default:
            return state
    }
}


function errorMsg(msg) {
    return { msg, type: ERROR_MSG }
}


export function clickTest() {
    return dispatch => {
        const data = {
            code: 1,
            info: '测试成功',
            data: 123123
        }
        dispatch(errorMsg(data))	
    }
}







